package com.ruoyi.hcrf.enums;

import cn.hutool.core.util.StrUtil;
import lombok.Data;

@Data
public class OrderField {
    private String fieldName;
    private String sort;

    public boolean isAsc() {
        return "ASC".equals(this.sort);
    }

    public boolean isDesc() {
        return "DESC".equals(this.sort);
    }

    @Override
    public String toString() {
        return StrUtil.join(this.fieldName," ",this.sort);
    }

    protected boolean canEqual(final Object other) {
        return other instanceof OrderField;
    }

    public OrderField(final String fieldName, final String sort) {
        this.fieldName = fieldName;
        this.sort = sort;
    }
}
